package com.honglv.controller.user;

import com.honglv.pojo.dto.UploadStrategyDTO;
import com.honglv.pojo.result.Result;
import com.honglv.service.StrategyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userStrategyController")
@Slf4j
@RequestMapping("/user")
@Api("攻略相关接口")
public class StrategyController {
    @Autowired
    private StrategyService strategyService;

    /**
     * 用户上传攻略
     * @param uploadStrategyDTO
     * @return
     */
    @PostMapping("/uploadStrategy")
    @ApiOperation("上传攻略")
    public Result uploadStrategy(@RequestBody UploadStrategyDTO uploadStrategyDTO){
        log.info("上传攻略:{}",uploadStrategyDTO);
        strategyService.upload(uploadStrategyDTO);
        return Result.success();
    }


}
